Next | Prev | Up | Top | Contents | Index

Introduction to Logical Volumes

The use of logical volumes enables the creation of filesystems, raw devices, or block devices that span more than one disk partition. Logical volumes behave like regular disk partitions; they appear as block and character devices in the /dev directory and can be used as arguments anywhere a disk device can be specified.

lv logical volume device files have the names /dev/dsk/lv<n> and /dev/rdsk/lv<n>, where <n> is a one or two digit integer. XLV logical volume device files have the names /dev/dsk/xlv/<volname> and /dev/rdsk/xlv/<volname>, where <volname> is an alphanumeric string that does not contain periods (dots, ".").

Filesystems can be created, mounted, and used in the normal way on logical volumes, or logical volumes can be used as block or raw devices. Logical volumes provide services such as disk plexing (also known as mirroring) and striping transparently to the applications that access the volumes. Key reasons to create a logical volume are:

The drawback to logical volumes is that all disks used in a logical volume must function correctly at all times. If you have a logical volume set up over three disks and one disk goes bad, the information on the other two disks is unavailable and must be restored from backups. However, by using the Disk Plexing Option optional software, you can create multiple copies, called plexes, of the contents of XLV logical volumes, which ensures that all of the information in an XLV logical volume is available even when a disk goes bad.

A logical volume can include partitions from several physical disk drives. By default, data is written to the first disk partition, then to the second disk partition, and so on. Figure 6-1 shows the order in which data is written to partitions in a non-striped logical volume.

Figure 6-1 : Writing Data to a Non-Striped Logical Volume Also, on striped logical volumes, the volume must have equal-sized partitions on several disks. When logical volumes are striped, an amount of data, called the stripe unit, is written to the first disk, the next stripe unit amount of data is written to the second disk, and so on. When each of the disks have been written to, the next stripe unit of data is written to the first disk, the next stripe unit amount of data is written to the second disk, and so on to complete the "stripe." Figure 6-2 shows the order in which data is written to a striped logical volume.

Figure 6-2 : Writing Data to a Logical Volume Because each stripe unit in a stripe can be read and written simultaneously, I/O performance is improved. To obtain the best performance benefits of striping,try to connect the disks you are striping across on different controllers. In this arrangement, there are independent data paths between each disk and the system. However, a small performance improvement can be obtained using SCSI disks striped on the same controller.

There are two basic scenarios for creating logical volumes. In the first scenario, you start with empty disks and perform these basic steps:

  1. Create disk partitions as necessary (see "Repartitioning a Disk With fx" in Chapter 2).

  2. Create the logical volume.

  3. Make a filesystem on the logical volume (see "Making an EFS Filesystem" or "Making an XFS Filesystem" in Chapter 4).
In the second scenario for creating logical volumes, you have a filesystem on a disk partition. You'd like to increase the size of the filesystem ("grow" the filesystem) by creating a logical volume that includes the existing disk partition and a new disk partition. This procedure is explained in the sections "Growing an XFS Filesystem Onto Another Disk" (for XLV logical volumes) and "Growing an EFS Filesystem Onto Another Disk" in Chapter 4 (for lv logical volumes).

The next two sections in this chapter describe the features of lv and XLV logical volumes.



Next | Prev | Up | Top | Contents | Index